<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class variable_model extends model {
	function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'variable_nsr';
		parent::__construct();
	}
	
	/**
	 * 根据变量名称获取变量值
	 * @param unknown $name
	 */
	public function getValue($name) {
		$where = "";
		$where .= "name='$name' and status=1";
		$vinfo = array();
		$info = $this->select($where);
		foreach ($info as $k=>$v){
			$vinfo[$v['value']] = $v['value'];
		}
		return $vinfo;
	}
}
?>